<template>
  <div>
    <van-tabs v-model="active" title-active-color="red" title-inactive-color="black" sticky>
  <van-tab title="正在疯抢">
    <div class="left">
        <div class="left-box" v-for="(v,index) in arr" :key="index">
            <div class="lb">
                <img :src="v.scr" alt="">
            </div>
            <div class="rb">
                <p class="p1">{{v.shop}}</p>
                <p class="p2"><span>￥</span>{{v.price}}</p>
                <img src="../../../assets/img/10.png" alt="">
            </div>
        </div>
    </div>
  </van-tab>
  <van-tab title="抢先看">
    <div class="right">
        <div class="right-box">
            <div class="left">
        <div class="left-box" v-for="(v,index) in arr1" :key="index">
            <div class="lb">
                <img :src="v.scr" alt="">
            </div>
            <div class="rb">
                <p class="p1">{{v.shop}}</p>
                <p class="p3">00:00开抢</p>
                <p class="p4"><span>￥</span>{{v.price}}</p>
                <img src="../../../assets/img/11.png" alt="" class="tp">
            </div>
        </div>
    </div>
        </div>
    </div>
</van-tab>
</van-tabs>
  </div>
</template>

<script>
import axios from "axios"
let service = axios.create()
export default {
    data() {
        return {
        active: 2,
        arr:[],
        arr1:[],
    }
  },
  mounted(){
    service({
            url:"http://localhost:3000/lhseckill",
            method:"get"
        }).then((res)=>{
            this.arr = res.data
        }),
        service({
            url:"http://localhost:3000/lhseckillr",
            method:"get"
        }).then((res)=>{
            this.arr1 = res.data
        })
  },
}
</script>

<style scoped>
.top {
    width: 100%;
    height: 52px;
    border-bottom: 1px solid #e5e5e5;
}

.left {
    width: 100%;
    height: auto;
}
.left-box {
    width: 100%;
    height: 130px;
    display: flex;
}
.rb {
    width: 220px;
    height: 130px;
    border-bottom: 1px solid #eee;
    position: relative;
}
.lb {
    width: 150px;
    height: 130px;
    text-align: center;
}
.lb img{
    width: 120px;
    height: 120px;
}
.rb img {
    display: block;
    width: 76px;
    height: 54px;
    float: right;
}
.rb .tp {
    display: block;
    width: 76px;
    height: 54px;
    position: absolute;
    right: 0;
    bottom:0;
    
}
.rb .p1 {
    white-space: nowrap;overflow: hidden;text-overflow: ellipsis;
    font-size: 15px;
}
.rb .p2 {
    font-size: 23px;
    color: red;
    font-weight: 500;
    margin: 0;
}
.rb .p4 {
    font-size: 23px;
    color: red;
    font-weight: 500;
    margin-top: 15px;
}
.rb .p3 {
    font-size: 12px;
    color: #17D579;
    margin: 0;
}
.rb span {
    font-size: 13px;
    color: red;
}
.left-box {
    margin-top: 5px;
}

</style>